package com.gues.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gues.eneity.User;
import com.gues.mapper.UserMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserService {

    @Resource
    UserMapper userMapper;

    public int change( User user) {
        return userMapper.updateById(user);
    }

    public User selectUserByUsernamer(String username) {
        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("username", username);
        return userMapper.selectOne(queryWrapper);
    }
}
